<cfparam name="aid" default="0">

<cfif fileexists("#request.basepath#docs/includes/account_welcome.cfm")>
	<cfsavecontent variable="welcome_msg">
	    <cfinclude template="#request.absolutepath#docs/includes/account_welcome.cfm">
	</cfsavecontent>

	<cfinvoke component="cfcs.accounts.account" method="getuserbyaid" aid="#aid#" returnvariable="quser">

	<!---replace variables--->
	<cfloop from="1" to="#listlen(quser.columnlist)#" index="i">
    	<cfset this_var = listgetat(quser.columnlist, i)>
        <cfset this_val = "quser.#this_var#">
        <cfset this_val = evaluate(this_val)>
		<cfset welcome_msg = replacenocase(welcome_msg, "{#this_var#}", this_val, "ALL")>
	</cfloop>	            
	<cfoutput>#welcome_msg#</cfoutput>
<cfelse>
	<!---since there is no welcome page, just display nothing and execute any plugins below--->
</cfif>

<!---execute any plugins--->
<cfif fileexists('#request.basepath#plugins/account_create/onwelcome.cfm')>
	<cfinclude template="#request.absolutepath#plugins/account_create/onwelcome.cfm">
</cfif>
